from .base import db, Base


class Book(Base):
    id = db.Column(db.Integer, primary_key=True, autoincrement=True) # 主键
    title = db.Column(db.String(50),nullable=False)
    author = db.Column(db.String(50),default='未名')
    binding = db.Column(db.String(20))
    publisher = db.Column(db.String(50)) # 出版商
    price = db.Column(db.String(20)) # 价格
    pages = db.Column(db.Integer) # 页数
    pubdate = db.Column(db.String(20)) # 出版日期
    isbn = db.Column(db.String(15),nullable=False,unique=True)
    summary = db.Column(db.String(1000)) # 概要
    image = db.Column(db.String(50))

    def sample(self):
        pass